package weekMatch.two_106;

import java.util.ArrayList;
import java.util.List;

public class LeeCode_04 {
    public static void main(String[] args) {
        System.out.println(goodSubsetofBinaryMatrix(new int[][]{{0, 1, 1, 0,}, {0, 0, 0, 1}, {1, 1, 1, 1}}));
    }
    private static List<Integer> goodSubsetofBinaryMatrix(int[][] grid) {
        int m = grid.length, n = grid[0].length;
        for (int i = 0; i < m; i++) {
            boolean f = true;
            for (int k = 0; k < n; k++) {
                if (grid[i][k] == 1){
                    f = false;
                    break;
                }
            }
            if (f){
                List<Integer> list = new ArrayList<>();
                list.add(i);
                return list;
            }
            for (int j = i + 1; j < m; j++) {
                boolean flag = true;
                for (int k = 0; k < n; k++) {
                    if (grid[i][k] == 1 && grid[j][k] == 1) {
                        flag = false;
                        break;
                    }
                }
                if (flag){
                    List<Integer> list = new ArrayList<>();
                    list.add(i);
                    list.add(j);
                    return list;
                }
            }
        }
        return new ArrayList<>();
    }
}